// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import MintUI from 'mint-ui'
import 'mint-ui/lib/style.css'
import 'swiper/dist/css/swiper.css';
import App from './App'
import router from './router'
import axios from 'axios'
import  '../static/js/rem';
import VueAwesomeSwiper from 'vue-awesome-swiper'
Vue.use(VueAwesomeSwiper)
import Calendar from 'vue-mobile-calendar'
Vue.use(Calendar)
import weVue from 'we-vue'
Vue.use(weVue)
import 'swiper/dist/js/swiper.js'
import Store from "./Store"
import common from '../static/js/common';
import wxshare from '../static/js/wxshare'

Vue.prototype.common= common;
Vue.config.productionTip = false
Vue.use(MintUI)
window.store = new Store();
//Vue.use(axios)
// axios.defaults.withCredentials = true;//让ajax携带cookie
Vue.prototype.getStore = () => window.store;
Vue.prototype.$axios = axios;
axios.defaults.withCredentials=true;
Vue.prototype.wxshare = wxshare;//配置微信分享的接口
Vue.prototype.$host1 = "https://www.metyou.wang/";
Vue.prototype.isapp=0;
document.addEventListener('RNMsg', function (e) {
  Vue.prototype.isapp = e.detail;
});
Vue.prototype.AlertWin = function(text){
  var newNode = document.createElement("div");
  newNode.id="mask_f";
  newNode.innerHTML ="<span>"+text+"</span>";
  document.body.appendChild(newNode);
  setTimeout(function(){
      document.body.removeChild(document.getElementById("mask_f"));
  },1000)
},
Vue.prototype.setSession = function(key, value) {
    window.sessionStorage.setItem(key, JSON.stringify(value));
  },
Vue.prototype.getSession = function(key) {
    let value = window.localStorage.getItem(key);
    return JSON.parse(value);
  },
/* eslint-disable no-new */
new Vue({
  el: '#app',
  data: {
    store: window.store
  },
  router,
  components: { App },
  template: '<App/>'
})
